package com.qingsong.dto;

import com.qingsong.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author qingsong
 */
@Schema(name = "评论添加DTO")
@Data
public class CommentInsertDTO implements Serializable, RE {

    @NotNull(message = "集次ID不能为空")
    @Schema(description = "集次ID,集次表外键")
    private Long fkEpisodeId;

    @NotNull(message = "用户ID不能为空")
    @Schema(description = "用户ID,用户表外键")
    private Long fkUserId;

    @Pattern(regexp = CONTENT_RE, message = CONTENT_RE_MSG)
    @Schema(description = "评论内容")
    private String content;

    @Range(min = 0, message = "序号最小为0")
    @Schema(description = "序号")
    private Long pid;
}